package com.vincent.guava.basics;

import org.testng.annotations.Test;

import com.google.common.base.CharMatcher;

public class CharMatcherTester {
	
	@Test
	public void test(){
		String input = "Today is 2012/08/10";
		CharMatcher charMatcher = CharMatcher.DIGIT.or(CharMatcher.is('/'));
		String output = charMatcher.retainFrom(input);
		
		System.out.println(input);
		System.out.println(output);
	}
	
	@Test
	public void testNegate(){
		String input = "I LOVE to work for MAAII!";
		CharMatcher charMatcher = CharMatcher.JAVA_LOWER_CASE.or(CharMatcher.WHITESPACE).negate();
		String output = charMatcher.retainFrom(input);
		
		System.out.println(input);
		System.out.println(output);
	}
	
}
